<?php get_header();?>
<?php get_template_part('left','menu');?>
<section> 
    <!--s container-->
    <div class="container">
	<div class="wrap">
	<div class="mallClass" style=" padding-top:10px">
	<span>商家：</span>
	<a href="<?php bloginfo('url'); ?>/details"  class="current" >全部</a>
	<?php
	$tag_args = array(
		'smallest'=>10,
		'largest'=>10,
		'orderby'=>'count',
		'taxonomy'=>'shop'
	);
	wp_tag_cloud($tag_args); ?>
	<div class="clear"></div>	
</div>
	<div class="masonryWrap" id='love_content'>
	<?php if( have_posts() ) : $count = 0; while( have_posts() ) : the_post(); $count++; ?>
		<div class="masonryBrick">
			<div class="blBox">
				<div class="blPic">
				<a href="<?php echo home_url('/');?>go/<?php echo $post->ID?>" rel="nofollow" class="border_radius_3" target="_blank">
				<?php
				if( has_post_thumbnail() ){
					echo get_the_post_thumbnail( $post->ID, array(190, 190), array('alt'=>$post->post_title) );
				}else{
					echo '<img src="'.get_post_img( '', 190, 190 ).'" alt="'.$post->post_title .'" width="190" height="190"/>';
				}
				?>
				</a>
				<div class="blStore">
				<?php $terms = get_the_terms( $post->ID, 'mall' );
			if ( $terms && ! is_wp_error( $terms ) ) : 
				$draught_links = array();
				foreach ( $terms as $term ) {
					$draught_links[] = $term->name;
					}
				$on_draught = join( ", ", $draught_links );
				echo $on_draught;
			endif; ?>
				</div>
				</div>
				<a class="mB10 blTitle" href="<?php the_permalink();?>" target="_blank"><?php the_title();?><span class="red">&nbsp;&nbsp;&nbsp;<?php echo get_post_meta($post->ID,"_red_title",true);?></span></a>
				<div class="blInfo mB10">
				<strong><?php if(get_post_meta($post->ID,'_post_author',true)){ echo get_post_meta($post->ID,'_post_author',true); }else{ the_author();} ?>：</strong><?php echo mb_substr($post->post_title,0,50,'UTF-8');?><div class="blTime"><?php the_time('m-d');?></div>
				</div>	
				<div class="blBot">
					<div class="blLike">
					<a class='love_collect' href="javascript:void(0);" id="<?php echo the_ID(); ?>" title="收藏本文" class="add_to_fav"><?php echo get_post_fav_count($post->ID);?></a>
					<div class="blLikeTip">
					<div class="blLikeTipInner" id='textcollect_<?php echo the_ID(); ?>'>收藏</div><div class="blLikeTipBot"></div></div>
					</div>
					<div class="blComment"><?php comments_popup_link( '0', '1', '%'); ?></div>
					<div class="blzd"><a href="<?php echo home_url('/');?>go/<?php echo $post->ID?>" rel="nofollow" class="border_radius_3" target="_blank">直 达 链 接</a></div>
					<div class="clear"></div>
				</div>
			</div>
		</div>
	<?php if( $count == 3 ) :　?>
					<div id="tagsOne" class="masonryBrick">
					<div class="findTag">
						<div class="findTitleTag">热门标签</div>
							<?php
							$tag_args = array(
								'smallest'=>12,
								'largest'=>12,
								'orderby'=>'count',
								'number'=>20,
								'taxonomy'=>'detail_tag'
							);
							wp_tag_cloud($tag_args);
							?>
						<div class="clear"></div>
					</div>
				</div>
		<?php endif; endwhile;endif; ?>
		</div>
		<?php pagenavi();?>
	</div>
<div class="clear"></div>
</div> 
</section>
<?php get_footer();?>